package com.sy.learn;

/**
 * 方法重写
 * 类方法的返回类型和父类方法返回类型一样，或者是父类返回类型的子类
 */
public class java_0302 {
    public Object m1(){
        return null;
    }

    public AAA m2(){return null;}
}

class Test extends java_0302{
    public String m1(){
        return null;
    }

    //应为BBB是AAA的子类
    public BBB m2(){return null;}
}

class AAA{}

class BBB extends AAA{}

